package com.example.javatwo.controller.cg.yt;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.example.javatwo.pojo.cg.yt.DsDataSet1;
import com.example.javatwo.service.cg.yt.CgqgdService;

@Controller
@RequestMapping("/cgqgd")
public class CgqgdController {
	
	@Autowired
	private CgqgdService cgqgdService;
	
	@RequestMapping("/index")
	public String index()throws Exception{
		
		return "cg/yt/cgqgd";
	}
	
	@ResponseBody
	@RequestMapping("/load")
	public Object load( int pageNum)throws Exception{
		System.out.println(pageNum);
		return cgqgdService.list(pageNum);
	}
	
	@ResponseBody
	@RequestMapping("/add")
	public Object add(@RequestBody DsDataSet1 dsDataSet1)throws Exception{
		System.out.println(dsDataSet1);
		cgqgdService.add(dsDataSet1);
		return "添加成功";
	}
	
	@ResponseBody
	@RequestMapping("/update")
	public void update(@RequestBody DsDataSet1 dsDataSet1)throws Exception{
		System.out.println(dsDataSet1);
		cgqgdService.update(dsDataSet1);
	}
	
	@ResponseBody
	@RequestMapping("/del")
	public void del(@RequestBody String billNo)throws Exception{
		System.out.println(billNo);
		cgqgdService.del(billNo);
	}
	
	@ResponseBody
	@RequestMapping("/auditing")
	public Object auditing(@RequestBody String billNo)throws Exception{
		return cgqgdService.auditing(billNo);
	}
	
	@ResponseBody
	@RequestMapping("/auditingss1")
	public Object auditing1(@RequestBody String billNo)throws Exception{
		System.out.println(billNo);
		return cgqgdService.auditing1(billNo); 
	}
} 